﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows;

namespace SqLiteEditor
{
    public class GlobalOption
    {
        static GlobalOption()
        {
            GlobalSettings = new GlobalSettings();
        }

        public static GlobalSettings GlobalSettings
        {
            get;
            set;
        }
    }

    public class GlobalSettings : INotifyPropertyChanged
    {
        public GlobalSettings()
        {
            FontSize = 12;
            FlowDir = FlowDirection.RightToLeft;
        }


        private FlowDirection mFlowDir;
        public FlowDirection FlowDir
        {
            get { return mFlowDir; }
            set
            {
                mFlowDir = value;
                NotifyStaticPropertyChanged("FlowDir");
            }
        }

        private double mFontSize;
        public double FontSize
        {
            get { return mFontSize; }
            set
            {
                mFontSize = value;
                NotifyStaticPropertyChanged("FontSize");
            }
        }

        private double mGridFontSize;
        public double GridFontSize
        {
            get { return mGridFontSize; }
            set
            {
                mGridFontSize = value;
                NotifyStaticPropertyChanged("GridFontSize");
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        public void NotifyStaticPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(null, new PropertyChangedEventArgs(propertyName));
        }
    }
}
